import requests

# 设置要访问的url
base_url = "https://www.baidu.com"
# 通过get请求访问
response = requests.get(base_url)
# 制定字符集
response.encoding = "utf-8"
# 打印响应的结果
print(response.status_code)
print(response.text)